package com.xiaoxi.common.constant.enumeration.statuscode.user;

import com.xiaoxi.common.constant.enumeration.statuscode.ParentEnum;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author xiaoxi
 * @ProjectName bms
 * @PackageName com.xiaoxi.bms.common.constant.enumeration.statuscode.user
 * @ClassName CodeModelEnums
 * @Description TODO
 * @Date 2022/11/9 9:23
 * @Version 1.0
 */
public enum CodeModelUserEnums implements ParentEnum {

    CODE_TYPE_EXIST("A120","代码标识重复"),
    CODE_NAME_EXIST("A121","代码名称重复"),
    SQL_MUST_SELECT("A122","SQL必须SELECT语句"),
    SQL_TEXT_EMPTY("A123","SQL文本为空");

    private final String code;
    private final String message;

    CodeModelUserEnums(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    @Override
    public Map<String, String> format() {
        Map<String, String> enumData = new HashMap<>();
        enumData.put("code", this.code);
        enumData.put("message", this.message);
        return enumData;
    }
}
